<?php
/**
 * Yii view _form_bussiness
 *
 * @author nguyenmanhluu
 * @since Jul 15, 2013 - 10:31:02 PM
 */
?>
<div class="span6">
    <div class="control-group">
        <?php echo $form->labelEx($model, 'business_name', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'business_name', array(
                'placeholder' => $model->getAttributeLabel('business_name'),
                'class'       => 'input-file uniform_on input-reset',
//                'readonly' => isset($isProfile) ? "readonly" : false
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'business_name'); ?></font>
        </div>
    </div>

    <div class="control-group">
        <?php echo $form->labelEx($model, 'website', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'website', array(
                'placeholder' => $model->getAttributeLabel('website'),
                'class'       => 'input-file uniform_on input-reset'
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'website'); ?></font>
        </div>
    </div>

    <div class="control-group">
        <?php echo $form->labelEx($model, 'address', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'address', array(
                'placeholder' => $model->getAttributeLabel('address'),
                'class'       => 'input-file uniform_on input-reset'
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'address'); ?></font>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'address2', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'address2', array(
                'placeholder' => '(Optional)',
                'class'       => 'input-file uniform_on input-reset'
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'address2'); ?></font>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="area_user">Area</label>
        <div class="controls">
            <?php
            echo CHtml::dropDownList('area_user[]', AreaUser::getUserAreaArray($model->id), Area::getAllarea(), array(
                'multiple data-rel' => "chosen",
                'data-placeholder'  => "Select some area..."
            ));
            ?>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'postal_code', array('class' => 'control-label')) ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'postal_code', array(
                'class'       => 'input-file uniform_on input-reset',
                'placeholder' => $model->getAttributeLabel('postal_code')))
            ?>
            <font color="red"> <?php echo $form->error($model, 'postal_code'); ?> </font>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'country', array('class' => 'control-label')); ?>
        <div class ="controls">                                    
            <?php echo $form->dropDownList($model, 'country', Country::getAllCountry(), array('options' => array('SGP' => array('selected' => true)))); ?>
            <font color="red"><?php echo $form->error($model, 'country'); ?></font>
        </div>
    </div>
    <?php if ($this->isAdmin): ?>
        <div class="control-group">
            <?php echo $form->labelEx($model, 'contract_start', array('class' => 'control-label')); ?>
            <div class ="controls">
                <?php
                echo $form->textField($model, 'contract_start', array(
                    'placeholder' => $model->getAttributeLabel('contract_start'),
                    'class'       => 'datepicker'
                ));
                ?>
                <font color="red"><?php echo $form->error($model, 'contract_start'); ?></font>
            </div>
        </div>
        <div class="control-group">
            <?php echo $form->labelEx($model, 'contract_end', array('class' => 'control-label')); ?>
            <div class ="controls">
                <?php
                echo $form->textField($model, 'contract_end', array(
                    'placeholder' => $model->getAttributeLabel('contract_end'),
                    'class'       => 'datepicker'
                ));
                ?>
                <font color="red"><?php echo $form->error($model, 'contract_end'); ?></font>
            </div>
        </div>
    <?php endif; ?>

    <div class="control-group">
        <?php echo $form->labelEx($model, 'office_phone', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'office_phone', array(
                'placeholder' => $model->getAttributeLabel('office_phone'),
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'office_phone'); ?></font>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'mobile_phone', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'mobile_phone', array(
                'placeholder' => $model->getAttributeLabel('mobile_phone'),
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'mobile_phone'); ?></font>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'facebook', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'facebook', array(
                'placeholder' => $model->getAttributeLabel('facebook'),
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'facebook'); ?></font>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'twitter', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'twitter', array(
                'placeholder' => $model->getAttributeLabel('twitter'),
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'twitter'); ?></font>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'gplus', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'gplus', array(
                'placeholder' => $model->getAttributeLabel('gplus'),
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'gplus'); ?></font>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'instagram', array('class' => 'control-label')); ?>
        <div class ="controls">
            <?php
            echo $form->textField($model, 'instagram', array(
                'placeholder' => $model->getAttributeLabel('instagram'),
            ));
            ?>
            <font color="red"><?php echo $form->error($model, 'instagram'); ?></font>
        </div>
    </div>
    <!--    <div class="control-group">
    <?php // echo $form->labelEx($model, 'latitude', array('class' => 'control-label')); ?>
            <div class ="controls">
    <?php
//            echo $form->textField($model, 'latitude', array(
//                'placeholder' => $model->getAttributeLabel('latitude'),
//            ));
    ?>
                <font color="red"><?php // echo $form->error($model, 'latitude');   ?></font>
            </div>
        </div>-->
    <!--    <div class="control-group">
    <?php // echo $form->labelEx($model, 'longitude', array('class' => 'control-label')); ?>
            <div class ="controls">
    <?php
//            echo $form->textField($model, 'longitude', array(
//                'placeholder' => $model->getAttributeLabel('longitude'),
//            ));
    ?>
                <font color="red"><?php // echo $form->error($model, 'longitude');   ?></font>
            </div>
        </div>-->
    <!--<div class="control-group">-->
    <?php // echo $form->labelEx($model, 'business_type', array('class' => 'control-label')); ?>
    <!--<div class ="controls">-->
    <?php
//            echo $form->textField($model, 'business_type', array(
//                'placeholder' => $model->getAttributeLabel('business_type'),
//            ));
    ?>
        <!--<font color="red"><?php // echo $form->error($model, 'business_type');   ?></font>-->
    <!--</div>-->
    <!--</div>-->
    <div class="control-group">
        <label class="control-label" for="merchant_cat">Merchant Category</label>
        <div class="controls">
            <?php
            echo CHtml::dropDownList('merchant_cat[]', BusinessCategoryUser::getMerchantCatArray($model->id), BusinessCategory::getAllArray(), array(
                'multiple data-rel' => "chosen",
                'data-placeholder'  => "Select some category..."
            ));
            ?>
            <font color="red"><?php // echo $form->error($model, 'longitude');               ?></font>
        </div>
    </div>
</div>
<div class="clearfix"></div>
<div class="control-group hidden-phone">
    <?php echo $form->labelEx($model, 'business_slogan', array('class' => 'control-label')); ?>
    <div class ="controls">
        <?php
        echo $form->textArea($model, 'business_slogan', array(
            'class'       => 'cleditor',
            'rows'        => 3,
            'placeholder' => $model->getAttributeLabel('business_slogan'),
        ));
        ?>
        <font color="red"><?php echo $form->error($model, 'business_slogan'); ?></font>
    </div>
</div>
<div class="control-group hidden-phone">
    <?php echo $form->labelEx($model, 'business_description', array('class' => 'control-label')); ?>
    <div class ="controls">
        <?php
        echo $form->textArea($model, 'business_description', array(
            'class'       => 'cleditor',
            'rows'        => 3,
            'placeholder' => $model->getAttributeLabel('business_description'),
        ));
        ?>
        <font color="red"><?php echo $form->error($model, 'business_description'); ?></font>
    </div>
</div>
<?php
echo $this->renderPartial('//user/_form_biz_frontend', array(
    'biz' => $model
));
?>